1. Field of the Invention
The invention relates to synchronizing the execution of calls at a server and a client in a server and client system.
2. Description of the Related Art
With the availability of modern communication networks connecting large numbers of data processing devices, an increasing number of applications or services for users is executed involving more than a single data processing device.
A large number of such distributed applications are available today and may be executed on a plurality of data processing devices. Distributed applications may, for example, include office applications such as managing documents and data files, and may include visualizing information, banking services, shopping services and the like.
A distributed application or service may be executed involving a server data processing device and a client data processing device, the client data processing device being operated by a user. A user may, for example, launch a distributed application by entering a suitable instruction at the client data processing device. The client data processing device will then connect to the server data processing device to execute the application. Some parts of modules of the application may reside on the client data processing device, whereas other parts or modules of the application may reside at the server data processing device. The distributed application requires a potentially complex cooperation between modules executed at the client data processing device and modules of the distributed application executed at the server data processing device.
For example, a distributed application involving visualizing a document at the client data processing device may include (1) application modules executed at the server for processing or rendering the document in order to convert the document into a format which may be displayed at a display unit of the client, and (2) modules executed at the client data processing device for receiving frames for local display and supplying the frames to a display unit. If the user, moreover, wishes to edit the document, control information and further information to be visualized may be exchanged between the client data processing device and the server data processing device.
The above modules or parts of the distributed application at the client and at the server may run on data processing units starting corresponding processes. Such a process may involve the execution of one or a plurality of different threads, each of the threads generating a plurality of individual service calls, i.e., service calls to be transmitted to the client or server.
In order to achieve acceptable performance, the individual threads of the processes may be executed asynchronously, i.e., calls of different threads are not executed in a predetermined given sequence, as this could lead to delays for example, if one thread waits for a return message. Instead, the calls are executed asynchronously, i.e., if a thread for example, waits for a return message or the like, other threads may be executed.
An asynchronous execution of an application may be guarded by a MUTEX (Mutually Exclusive), i.e., a programming flag used to grab and release an object or thread when data is acquired that cannot be shared between different threads, or processing can be started that cannot be performed simultaneously elsewhere in the system. If exclusive operation of one thread must be shared, the MUTEX locks other attempts to use the respective resources of the system. The MUTEX unlocks the resources when the resources are no longer needed or a particular thread is finished.
In a scenario where a distributed application is executed at a server data processing device and a client data processing device, a MUTEX or scheduler may be used to guard the asynchronous execution of tasks at the server.
However, since the scheduler is only available at the server, calls from different threads which interact with the client, i.e., for exchanging data, sending requests and commands and the like, may overtake one another on the client side due to the scheduled execution at the server.
Thus, the sequence of calls from different threads at the server, due to the fact that the exact sequence of calls of different threads, i.e., the operation of the scheduler, is not known at the client, may not be maintained when executing the corresponding calls of corresponding threads at the client.
Further, if different calls from different threads overtake each other, processing results may be unacceptable. For example, in a visualization application, as a practical example, drawn objects on a client display unit may be moved from the foreground to the background, as a drawing sequence of objects may be changed.
Accordingly, the synchronization of the execution of calls of different threads at the server and the client is not maintained and causes unacceptable processing results.
It is therefore desirable to provide an improved method and system to allow the synchronization of the execution of calls in a client and server system.